package main

//
//import (
//	"fmt"
//)
//
//// VehicleType represents the type of vehicle.
//type VehicleType int
//
//const (
//	Unknown VehicleType = iota
//	Motorcycle
//	Car
//	Bus
//)
//
//// Vehicle represents a generic vehicle.
//type Vehicle struct {
//	Type      VehicleType
//	CostSpots int
//	atLevel   *Level
//	atSpots   []Spot
//}
//
//// Spot represents a parking spot.
//type Spot struct {
//	X, Y int
//}
//
//// GetRange is a method that should be implemented by each vehicle type.
//func (v *Vehicle) GetRange(n int) []int {
//	return nil
//}
//
//// UnPark unassigns the vehicle from its parking spots.
//func (v *Vehicle) UnPark() {
//	if v.atLevel != nil {
//		for _, spot := range v.atSpots {
//			delete(v.atLevel.spots, spot)
//		}
//		v.atLevel = nil
//		v.atSpots = nil
//	}
//}
//
//// Motorcycle represents a motorcycle.
//type MotorCycle struct {
//	Vehicle
//}
//
//// GetRange returns a range of spots for a motorcycle.
//func (m *Motorcycle) GetRange(n int) []int {
//	return getRange(n)
//}
//
//// Car represents a car.
//type Car struct {
//	Vehicle
//}
//
//// GetRange returns a range of spots for a car.
//func (c *Car) GetRange(n int) []int {
//	return getRange(n/4, n)
//}
//
//// Bus represents a bus.
//type Bus struct {
//	Vehicle
//}
//
//// GetRange returns a range of spots for a bus.
//func (b *Bus) GetRange(n int) []int {
//	return getRange(n/4*3, n)
//}
//
//// Level represents a parking level.
//type Level struct {
//	id    int
//	m, n  int
//	spots map[Spot]*Vehicle
//}
//
//// NewLevel creates a new parking level.
//func NewLevel(id, m, n int) *Level {
//	return &Level{
//		id:    id,
//		m:     m,
//		n:     n,
//		spots: make(map[Spot]*Vehicle),
//	}
//}
//
//// ParkVehicle attempts to park a vehicle in the level.
//func (l *Level) ParkVehicle(v *Vehicle) bool {
//	RANGE := v.GetRange(l.n)
//	for x := 0; x < l.m; x++ {
//		foundSpots := 0
//		var spots []Spot
//		for _, y := range RANGE {
//			spot := Spot{X: x, Y: y}
//			if _, occupied := l.spots[spot]; occupied {
//				foundSpots = 0
//				spots = nil
//				continue
//			}
//			foundSpots++
//			spots = append(spots, spot)
//			if foundSpots == v.CostSpots {
//				v.atLevel = l
//				v.atSpots = spots
//				for _, spot := range spots {
//					l.spots[spot] = v
//				}
//				return true
//			}
//		}
//	}
//	return false
//}
//
//// ParkingLot represents a parking lot with multiple levels.
//type ParkingLot struct {
//	levels []*Level
//}
//
//// NewParkingLot creates a new parking lot.
//func NewParkingLot(k, m, n int) *ParkingLot {
//	levels := make([]*Level, k)
//	for i := range levels {
//		levels[i] = NewLevel(i, m, n)
//	}
//	return &ParkingLot{levels: levels}
//}
//
//// ParkVehicle attempts to park a vehicle in the parking lot.
//func (p *ParkingLot) ParkVehicle(v *Vehicle) bool {
//	for _, level := range p.levels {
//		if level.ParkVehicle(v) {
//			return true
//		}
//	}
//	return false
//}
//
//// UnparkVehicle unassigns a vehicle from its parking spots.
//func (p *ParkingLot) UnparkVehicle(v *Vehicle) {
//	v.UnPark()
//}
//
//// getRange returns a range of integers.
//func getRange(start, end int) []int {
//	var rangeArray []int
//	for i := start; i < end; i++ {
//		rangeArray = append(rangeArray, i)
//	}
//	return rangeArray
//}
//
//func main() {
//	// Example usage:
//	parkingLot := NewParkingLot(2, 5, 10)
//	motorcycle := &Motorcycle{Vehicle{Type: Motorcycle, CostSpots: 1}}
//	car := &Car{Vehicle{Type: Car, CostSpots: 1}}
//	bus := &Bus{Vehicle{Type: Bus, CostSpots: 5}}
//
//	fmt.Println("Parking motorcycle:", parkingLot.ParkVehicle(&motorcycle.Vehicle))
//	fmt.Println("Parking car:", parkingLot.ParkVehicle(&car.Vehicle))
//	fmt.Println("Parking bus:", parkingLot.ParkVehicle(&bus.Vehicle))
//
//	parkingLot.UnparkVehicle(&motorcycle.Vehicle)
//}
